package ynu.elm.controller;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import ynu.elm.entity.Category;
import ynu.elm.service.CategoryService;

import java.util.List;

@RestController
@RequestMapping("/CategoryController")
public class CategoryController {
    @Resource
    private CategoryService categoryService;

    @GetMapping("/listCategories")
    public List<Category> listCategories() {
        return categoryService.listCategories();
    }
}